//渐变 黄=》白=》黄
var fade = function(node) {
	var level = 1;
	var flag = false;
	var step = function() {
		var hex = level.toString(16);
		node.style.backgroundColor = "#FFFF" + hex + hex;
		if(level < 15 && !flag) {
			level += 1;
			if(level === 15) flag = true;
			setTimeout(step, 100);
		} else if(level > 1 && flag) {
			level -= 1;
			if(level === 1) flag = false;
			setTimeout(step, 100);
		}
	};
	setTimeout(step, 200);
}

window.onload = () => {
	var text =document.querySelector('#text');
	fade(text);
}